/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import controller.WriteXMLFileCourse;
import java.io.IOException;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerException;
import org.xml.sax.SAXException;

/**
 *
 * @author Tina
 */
public class Course {
    public String coursename;
    public String coursetype;
    public University university;
	public int credits;
        public double foreignGrade = 0, homeGrade = 0; //vllt nicht optimale loesung, note nur bei student, so hat aber auch die kursverwaltung zugriff drauf
	public String courseDescription;
	String courseStorage = "Course Storage";
	

    public Course(String coursename, int credits, String courseDescription, String coursetype) {
        this.coursename = coursename;
        this.credits = credits;
        this.courseDescription = courseDescription;
        this.coursetype = coursetype;
    }

        
    public String getCoursename() {
        return coursename;
    }

    public void setCoursename(String coursename) {
        this.coursename = coursename;
    }

    public int getCredits() {
        return credits;
    }

    public void setCredits(int credits) {
        this.credits = credits;
    }

    public String getCourseDescription() {
        return courseDescription;
    }

    public void setCourseDescription(String courseDescription) {
        this.courseDescription = courseDescription;
    }

    public String getCourseStorage() {
        return courseStorage;
    }

    public void setCourseStorage(String courseStorage) {
        this.courseStorage = courseStorage;
    }

    public void saveCourse(String coursename, int credits, String courseDescription, String coursetype) throws SAXException, IOException, ParserConfigurationException, TransformerException {
        WriteXMLFileCourse.main(coursename, credits, courseDescription, coursetype);
    }

    public String getCoursetype() {
        return coursetype;
    }

    public void setCoursetype(String coursetype) {
        this.coursetype = coursetype;
    }
    
    public void setHomeGrade(int homeGrade){
        this.homeGrade = homeGrade;
    }
    
    public double getHomeGrade(double HomeGrade){
        return HomeGrade;
    }
    
    public void calculateHomeGrade(double gradeMultiplicator){
        this.homeGrade = this.foreignGrade * gradeMultiplicator;
    }
}
